<?php

namespace App\Models;

use App\Models\Traits\Btn;
use App\Observers\ApiUserObserver;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laravel\Passport\HasApiTokens;
use Illuminate\Foundation\Auth\User as Authenticatable;

class ApiUsers extends Authenticatable
{
    //使用自定义按钮
    use Btn;
    //使用软删除
    use SoftDeletes, HasApiTokens;
    //设置黑名单
    protected $guarded = [];
    //设置软删除字段
    protected $dates = ['deleted_at'];
    protected static function boot()
    {
        parent::boot();
        //注册接口账号的观察者
        self::observe(ApiUserObserver::class);
    }
}
